package com.sakuraio.nextj.core.error.exception;

import cn.hutool.core.util.StrUtil;
import com.sakuraio.nextj.core.error.Errors;
import com.sakuraio.nextj.core.protocol.ErrorDetails;
import com.sakuraio.nextj.core.protocol.R;

/**
 * <p>RequestValidationException</p>
 *
 * @author nekoimi 2023/03/23
 */
public class RequestValidationException extends BusinessException {

    public RequestValidationException(ErrorDetails errorDetails) {
        super(errorDetails);
    }

    public RequestValidationException(String message, Object... params) {
        super(R.error(Errors.REQUEST_VALIDATION.code(), StrUtil.format(message, params)).build());
    }
}
